package com.lu.manage.config.init;

import com.lu.manage.modular.system.service.SystemCacheService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @program sKnowledge_Blog
 * @description: 项目启动完成执行
 * @author: zhanglu
 * @create: 2019-07-06 21:22:00
 */
@Component
public class AfterServiceStarted implements CommandLineRunner {

    @Autowired
    private SystemCacheService systemCacheService;

    @Override
    public void run(String... args) throws Exception {

        //项目根目录
        String rootPath = System.getProperty("user.dir");
        System.out.println("项目根目录 ---> " + rootPath);
//        String imgRootPath = rootPath + File.separator + "img";
//        File file = new File(imgRootPath);
//        if(!file.exists()){
//            file.mkdirs();
//        }
//        GlobalCache.baseProperties.setImgRootPath(imgRootPath);
        systemCacheService.init();

    }

}
